package test0ne.设计模式.迭代器;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        DrivingRecord dr = new DrivingRecord();

        //录12段视频
        for (int i = 0; i < 12; i++) {
            dr.append("视频_"+i);
        }

//        dr.display();

        dr.displayOrder();

        List<String> accidents = new ArrayList<String>();

        Iterator<String> it = dr.iterator();
        while (it.hasNext()) {
            String video = it.next();
            System.out.println(video);

            if("视频_10".equals(video) || "视频_8".equals(video)) {
                accidents.add(video);
            }
        }

        System.out.println("事故证据："+accidents);
    }
}
